package com.cloud.core;

import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;

public class WordCount {


    static String lang = "go";
    static String input = "/Users/fuhaixu/Desktop/work/program_journey/cloud_computing/github_data_analysis/data/wcinput/" + lang + ".txt";
    static String output = "/Users/fuhaixu/Desktop/work/program_journey/cloud_computing/github_data_analysis/data/wcoutput/" + lang + ".txt";

    public static void main(String[] args) throws Exception {

        if (args.length < 2) {
            throw new Exception("args error");
        }

        String input = args[0];
        String output = args[1];
        String master = "spark://master:7077";
        if (args.length >= 3) {
            master = args[2];
        }

        SparkConf conf = new SparkConf()
                .setAppName("WordCount_11_23")
                .setMaster(master);

        SparkContext sc = new SparkContext(conf);

        sc.stop();
    }
}
